package spr

import (
	pl "db2s/Or/spr/parser"
)

type PlVisitor struct {
	pl.BasePlSqlParserVisitor
	Select *SelectParseS
}
type SelectFormatS struct {
	HeadBit   []int //头部标识
	Select    SelectParseS
	Operation string
	subSelect SelectParseS
	OrderBy   OrderCondition
	Limit     LimitCondition
}

type FromCondition struct {
	Type  string
	Value string
}
type SelectParseS struct {
	Column    []ColumnCondition
	From      []FromCondition
	Where     whereCondition
	GroupBy   string
	Having    HavingCondition
	OrderBy   []OrderCondition
	ForUpdate ForUpdateCondition
}

type ExpressionS struct {
}
type CombinedLogicalExpressionContext struct {
	BooleanOperation []string //多个表达式关联，按照顺序
	ManyExpression   []ExpressionS
}
type whereCondition struct {
	Type                      string
	CombinedLogicalExpression CombinedLogicalExpressionContext
}
type HavingCondition struct {
	Condition string
}
type OrderCondition struct {
	List string
	Sort string //ASC or DESC
}
type LimitCondition struct {
}
type ColumnCondition struct {
	HeadBit []int         //column 头部信息
	Value   string        //column 名
	AS      string        //别名
	Func    FunctionCallS //用到func
}

type ForUpdateCondition struct {
	column     []string
	options    string // SKIP_ LOCKED、NOWAIT、WAIT
	expression string //for update action
}
type FunctionCallS struct {
	Value    string
	Name     string //函数名
	Type     string //函数类型
	Argument []ArgumentS
}
type ArgumentS struct {
	Value string
}
type AggregateFuncCallS struct {
	Name string //函数名
	Args ArgumentS
}
